#!/bin/bash

# Check if the configuration file exists
if [ ! -f "$CONFIG_FILE_PATH" ]; then
  echo "Configuration file not found at $CONFIG_FILE_PATH"
  exit 1
fi

if [ "$1" = 'worker' ]; then
  exec celery -A pipeline.tasks worker --loglevel=info
elif [ "$1" = 'beat' ]; then
  exec celery -A pipeline.tasks beat --loglevel=info
else
  exec "$@"
fi
